{extend name="public/base"/}
{block name="body"}
<link href="/static/css/common.css" type="text/css" rel="stylesheet">
<link href="/static/css/index.css" type="text/css" rel="stylesheet">
<style type="text/css">
	input{border:solid 1px #ddd;height:31px;font-size:14px;padding-left:4px;}
	.formbox1{margin:5px 0;}
	.smname{margin:2px 0;}
	.select-boxs{display:inline-block;}
</style>
<title>编辑支付费用</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add">
		<input type="hidden" class="input-text" value="{$data.id}" id="id" name="id">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">n折：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="打n折" id="discount" name="discount">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">备注：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="打折备注" id="remarks" name="remarks">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input id="submit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>


<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript">
$("#submit").click(function() {
	layer.load(1, {
	  shade: [0.1,'#fff'] //0.1透明度的白色背景
	});
	var id=$("input[name=id]").val();
	var discount=$("input[name=discount]").val();
	var remarks=$("input[name=remarks]").val();
    $.ajax({
	    type: 'POST',
	    url: "{:url('price_edit')}",
	    data: {id:id,discount:discount,remarks:remarks},
	    success: function(resdata){
	        if(resdata.code==200){
				layer.msg(resdata.msg,{icon:1,time:1000});
				setTimeout("parent.location.reload()",1000);
	        }else{
				layer.msg(resdata.msg,{icon:2,time:3000});
	        }
	    },
	    error: function(){
			layer.msg('数据保存失败',{icon:2,time:3000});
	    }
	})
})
</script> 
{/block}